package com.cs.study.homework._0224;

public class Demo2 {
    public static void main(String[] args) {
        Car car = new Car("奔驰",300000,"E300");
        car.startEngine();
    }
}

class Car {
    String brand;
    double price;
    String model;

    public Car(String brand, double price, String model) {
        this.brand = brand;
        this.price = price;
        this.model = model;
    }

    public void startEngine() {
        Engine engine = new Engine();
        engine.run();
    }

    class Engine {
        public void run() {
            System.out.println("品牌：" + brand + " 车型:" + model + " 价格：" + price);
        }
    }
}